﻿//********************************************************************************//
//创建日期：<创建日期，2018-3-1>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：计划水用户欠费信息
//********************************************************************************//
using System;
using System.Collections.Generic;
using YXYLCommon;
using System.Data;

namespace Entity
{
    [Serializable]
    public class YSQFXX : BaseModel
    {
        public int I_FEIYONGBH { get; set; }
        public string S_YONGHUH { get; set; }
        public string S_YONGHUM { get; set; }
        public int I_YM { get; set; }
        public int I_SYL { get; set; }
        public int I_JJL { get; set; }
        public decimal N_JJJE { get; set; }
        public string S_JJJE { get { return N_JJJE.ToString("0.00"); } }
        public decimal N_YSJE { get; set; }
        public string S_YSJE { get { return N_YSJE.ToString("0.00"); } }
        public decimal N_SSJE { get; set; }
        public string S_SSJE { get { return N_SSJE.ToString("0.00"); } }
        public decimal N_QFJE { get; set; }
        public string S_QFJE { get { return N_QFJE.ToString("0.00"); } }

        public override BaseModel ToObject(System.Data.DataRow row)
        {
            this.IsExists = true;
            this.I_FEIYONGBH = row.Table.Columns.Contains("I_FEIYONGBH") ? Convert.ToInt32(row["I_FEIYONGBH"]) : 0;
            this.I_JJL = row.Table.Columns.Contains("I_JJL") ? Convert.ToInt32(row["I_JJL"]) : 0;
            this.I_SYL = row.Table.Columns.Contains("I_SYL") ? Convert.ToInt32(row["I_SYL"]) : 0;
            this.I_YM = row.Table.Columns.Contains("I_YM") ? Convert.ToInt32(row["I_YM"]) : 0;

            this.N_JJJE = row.Table.Columns.Contains("N_JJJE") ? Convert.ToDecimal(row["N_JJJE"]) : 0;
            this.N_QFJE = row.Table.Columns.Contains("N_QFJE") ? Convert.ToDecimal(row["N_QFJE"]) : 0;
            this.N_SSJE = row.Table.Columns.Contains("N_SSJE") ? Convert.ToDecimal(row["N_SSJE"]) : 0;
            this.N_YSJE = row.Table.Columns.Contains("N_YSJE") ? Convert.ToDecimal(row["N_YSJE"]) : 0;

            return this;
        }
    }
    public class DALYSQFXX : BaseDAL
    {
        protected override void fillSaveProc(BaseModel model)
        {

        }
        
        /// <summary>
        /// 获取历史欠费信息
        /// </summary>
        public List<YSQFXX> Get(string yhh)
        {
            dbProc.Init("P_YSZW_QFXX");
            dbProc.AddParameter("V_YONGHUH", yhh);
            return CommonService.Ini().GetList<YSQFXX>(dbProc);
        }
    }

}